<template>
  <div>
    <el-date-picker v-model="value" v-bind="elProps" @change="change">
    </el-date-picker>
  </div>
</template>

<script setup>
import { ref,watch } from "vue";
const props = defineProps({
  elProps: Object,
  modelValue: [String, Object,Array],
});

const value = ref([]);
value.value = props.modelValue;
watch(()=>props.modelValue,(newval,oldval)=>{
  console.log(newval,oldval);
value.value = newval
if (newval == null || !newval) {
  value.value = '1'
}
console.log(value.value);
})
const emit = defineEmits(["update:modelValue"]);
const change = () => {
  emit("update:modelValue", value.value);
};
</script>

<style lang='less' scoped>
.el-date-picker__prev-btn {
  background-color: red;
}
</style>